<?php
if (!defined('IN_ZWS')) exit();

class UserModel extends RelationModel {
	protected $tableName="User";
	protected $_link = array(
		'UserInfo' => array(
			'mapping_type' => HAS_ONE,
			'foreign_key'=>'uid',
			'mapping_name'=>'info',
			),
		'UserLog'=>array(
			'mapping_type'=>HAS_MANY,
			'foreign_key'=>'uid',
			'condition'=>'type=1',
			'mapping_order'=>'time desc',
			'mapping_name'=>'log',
			'mapping_limit'=>1,
		),
		'UserCredit'=>array(
			'mapping_type'=>HAS_ONE,
			'foreign_key'=>'uid',
			'mapping_name'=>'credit',
		)
		);
}
